<?php 
include_once(''.P.'/public/header.html');
?>


<style>
.lists{padding:5px;border-bottom:1px #dddddd solid}
</style>
<script>
function initbody(){
	isinstall = '<?=$isinstall?>';
	if(isinstall=='1'){
		js.alert('请去升级系统才能完整使用的。',function(){
			js.location('?d=plat&m=cog')
		});
	}
}
function guanzhue(aid){
	js.prompt('请输入手机号来验证关注',function(jg,txt){
		if(jg=='yes'){
			js.loading('验证中...');
			js.ajax({
				'url':'?m=index&a=joinactive',
				'data':{aid:aid,mobile:txt},
				dataType:'json',
				success:function(ret){
					if(ret.success){
						js.msgok('验证成功');
						js.reload();
					}else{
						js.msgerror(ret.msg);
					}
				}
			});
		}
	},'验证关注');
}
</script>
</head>

<body>

<?php 
include_once(''.P.'/public/top_my.html');
?>

<div align="center">

<div style="width:<?=$maxwidth?>;margin:20px 0px" align="left">
	<div style="color:#cccccc">
		<a href="" class="zhu"><?=lang('admin.myhome')?></a>
	</div>
	<div class="mainbody">
	
	
		<table width="100%">
		<tr valign="top"><td width="50%">
		
		<div style="margin:20px;padding:5px;">
			<div style="line-height:30px;color:gray">我创建的单位</div>
			<div>
				<table style="margin:0px" class="table table-striped table-bordered table-hover">
					<tr>
					<th>ID</th>
					<th>编号</th>
					<th></th>
					<th>单位名称</th>
					<th></th>
					</tr>
					<?php foreach($createcompany as $k=>$rs){?>
					<tr>
					<td><?=$rs['id']?></td>
					<td><?=$rs['num']?></td>
					<td  align="center"><img src="<?=$rs['logo']?>" height="30"></td>
					<td><?=$rs['name']?></td>
					<td><a class="webbtn webbtn-mini" href="?d=manage&cnum=<?=$rs['num']?>">管理</a></td>
					</tr>
					<?php }?>
				</table>
				
			</div>
			<?php
			if($adminrs['flaskm']>0)echo '<div style="line-height:50px"><a class="webbtn" href="?m=mycog&a=companyform&id=0">新增单位</a></div>';
			?>
			
		</div>
		</td><td>

		<div style="margin:20px;padding:5px;">
			<div style="line-height:30px;color:gray">我加入的单位</div>
			<div>
				<table style="margin:0px" class="table table-striped table-bordered table-hover">
					<tr>
				
					<th></th>
					<th>单位名称</th>
					<th></th>
					</tr>
					<?php foreach($joincompany as $k=>$rs){?>
					<tr>
			
					<td  align="center"><img src="<?=$rs['logo']?>" height="30"></td>
					<td><?=$rs['name']?></td>
					<td>
					<?php 
					if($rs['status']=='1')echo '<font color="green">已关注</font>&nbsp;<a class="webbtn webbtn-mini" href="?d=reim&cnum='.$rs['num'].'" target="_blank">进入</a>';
					if($rs['status']=='0')echo '<font color="blue">未关注</font>&nbsp;<a style="background:#66CCFF" class="webbtn webbtn-mini" href="javascript:;" onclick="guanzhue('.$rs['aid'].')">去关注</a>';
					if($rs['status']=='2')echo '<font color="gray">已停用</font>';
					?>				
					</td>
					</tr>
					<?php }?>
				</table>
				
			</div>
		</div>
		</td>
		</tr>
		</table>
		
		
	</div>
</div>



<?php 
include_once(''.P.'/public/footer.html');
?>
</div>

</body>
</html>